package com.cotasul.persistencia;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;

import com.cotasul.bean.interfaces.IBeanGenerico;
import com.cotasul.persistencia.interfaces.IDaoGenerico;

public abstract class DaoGenerico<P extends IBeanGenerico> implements
		IDaoGenerico<P> {

	protected Connection conn;
	protected String query;
	protected PreparedStatement ps;
	protected ResultSet rs;
	protected SimpleDateFormat df, df2;

	protected void fecharRecursos(PreparedStatement ps, ResultSet rs)
			throws Exception {

		try {
			if (ps != null) {
				ps.close();
			}
			if (rs != null) {
				rs.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}

	}

	
}
